package sample.web;

import com.sun.net.httpserver.HttpServer;
import java.io.IOException;
import java.net.InetSocketAddress;

public class WebApi {

    /**
     * @param args
     * @throws IOException
     * 提供http接口用于将分析记录写入报表文件中
     */
    public static void main(String[] args) throws IOException {
        HttpServer server = HttpServer.create(new InetSocketAddress(18000), 0);
        server.createContext("/", new WriteAnalysisHistory());
        server.start();
    }

    public void run() throws IOException {
        HttpServer server = HttpServer.create(new InetSocketAddress(18000), 0);
        server.createContext("/WriteAnalysisHistory", new WriteAnalysisHistory());
        server.createContext("/SavaToReport", new SavaToReport());
        server.start();
    }



}



